import request from '@/utils/request'

// 查询物流单列表
export function listLogisticsOrder(query) {
  return request({
    url: '/wms/logisticsOrder/list',
    method: 'get',
    params: query
  })
}

// 查询物流单详细
export function getLogisticsOrder(orderCode) {
  return request({
    url: '/wms/logisticsOrder/' + orderCode,
    method: 'get'
  })
}

// 查询物流单详细(确认到货)
export function getLogisticsOrderDh(orderCode) {
  return request({
    url: '/wms/logisticsOrder/qrDh/' + orderCode,
    method: 'get'
  })
}

// 新增物流单
export function addLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder',
    method: 'post',
    data: data
  })
}

// 修改物流单
export function updateLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder',
    method: 'put',
    data: data
  })
}

// 清关
export function customsClearLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder/customsClear',
    method: 'post',
    data: data
  })
}

// 清关
export function customsConfirmLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder/confirmSh',
    method: 'post',
    data: data
  })
}

// 上报异常
export function reportErrorLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder/reportError',
    method: 'post',
    data: data
  })
}

// 处理异常
export function handleErrorLogisticsOrder(data) {
  return request({
    url: '/wms/logisticsOrder/handleError',
    method: 'put',
    data: data
  })
}

// 查询异常信息
export function getLogisticsError(errorId) {
  return request({
    url: '/wms/logisticsOrder/getError/' + errorId,
    method: 'get'
  })
}

// 删除物流单
export function delLogisticsOrder(orderCode) {
  return request({
    url: '/wms/logisticsOrder/' + orderCode,
    method: 'delete'
  })
}
